updating code from the original project