Added init method to JS - not working yet