Added getAvalaibleJob and wrote the slave main