commented and refactored all but client file :/