Added filename as argument in save functions