moved parse functions into parse.rs, and changed how ps was handled in function