Started trace decode function and added functions for filling lines