Added options
Improved code (e.g. new parser and checking malloc for error)
Added checking malloc for error