moved to Jocker class rather than a long, horrible function