Initial commit

v1.0 of the script, tested for a whole night with my FB and PB and worked great.