Better data structures and cleaned up code, RSA wrapper added