addd js funccion fr faster writing
Added some functions, reworked structure of file