first implementation of parsing (still debugging)