Fixed bug with input conversion, added memory tracking