Completed basic polling logic; switched to an init() function.