Update main gem logic
First working draft with style issues