changed idea
fixed math
complete code
added new code