created simple implementation (not tested yet)
added tests and corrected mistake in parsing algorithm