Replaced require with require_relative and used 'inject' and 'find_all' instead of 'each'
Fixed range to be exclusive of 1000