plumbing ready for crop
implemented crop, a bit messy, needs a refactor