java code i've writen