initSTG reverse moved to fold for better performance