working, a few memory issues still