Added manual database code and modified automation code