simplifying if check
removing unnecessary cast
moving example test cases