Game loop logic updated