updated code and new problems