fixed off by one errors, added support for more than 2 screens