working malloc