Added some variable parsing. Needs refactoring