more progress.. still buggy