Working version of class rewrite - uploading to cluster