added apply, fixed parsing bug