parsing fully functional, some refactoring is probably there but... oh well