Added java implementations for problems 1-3