added RMI functionality (Stage 4). fixed a few minor bugs