added some parts for dependencies and made code readable