Working non-AJAX version, needs polish.. and tests