Home made symbolic calculator in Java