added fps counter/limit and minor improvements