added solve() and comments