Make -V work and added a cleanup function