Fixed syntactically errors, improved comments