2nd commit

Little Bug fixes, optimized code, improved java coding standards