malloc implementation (2 Solutions!!)