moved the connecting_to_bucket part outside of the script. functions now take the already instantiated bucket object as a parameter