Cleaned syntax, better errors and added some comments