added function parsing. currently broken though.