reverted to redseikio's commit
updated changes