working to finish logic