an attempt to solve #2