Cleaned up BS function
Fixed up semi function