small style changes
many style changes and addition of loop fallback