Fixed loop bug
Merge branch 'temp'
Revert "bug fixes"

This reverts commit 7b8e8fee50b6bcf5da5ec9a6ec0cad4a2e485502.