Refactored code: Made more object oriented and efficient; and added more customization options (gap size)