using case statment to parse