Unfinished key.java

Here's the unfinished key.java code. I will be quite busy this weekend
so I will not have much time to work on this during that time. I am
uploading it so that if you guys want to work on it, then you can.
Otherwise, I will try to finish this early next week.