works now - still needs improvement