Completed code with shearing

Need to add comments to code and possibility of refactoring