fixed plate calculation logic so it will no longer fall into an infinite loop