refactors and parsing
changed main