minor changes added parsing function