added parsing method and relevant tests