removed some console logs, added return vals