first implementation of parsing (not working yet)