moved java to javascript file