updated version with parse, not working fully yet