Second commit for Platform functionality, fixed some bugs